package hit.util;

import gui.common.SizeUnits;
import hit.core.Size;

public class SizeConverter {

	public static Size.Unit ConvertControllerUnitsToModel(SizeUnits from) {
		
		switch(from) {
		case Count: return Size.Unit.COUNT;
		case Pounds: return Size.Unit.POUNDS;
		case Ounces: return Size.Unit.OUNCES;
		case Grams: return Size.Unit.GRAMS;
		case Kilograms: return Size.Unit.KILOGRAMS;
		case Gallons: return Size.Unit.GALLONS;
		case Quarts: return Size.Unit.QUARTS;
		case Pints: return Size.Unit.PINTS;
		case FluidOunces: return Size.Unit.FLUID_OUNCES;
		case Liters: return Size.Unit.LITERS;
		default: return null;
		}
	}
	
	
	public static SizeUnits ConvertModelUnitsToController(Size.Unit from) {
		
		switch(from) {
		case COUNT: return SizeUnits.Count;
		case POUNDS: return SizeUnits.Pounds;
		case OUNCES: return SizeUnits.Ounces;
		case GRAMS: return SizeUnits.Grams;
		case KILOGRAMS: return SizeUnits.Kilograms;
		case GALLONS: return SizeUnits.Gallons;
		case QUARTS: return SizeUnits.Quarts;
		case PINTS: return SizeUnits.Pints;
		case FLUID_OUNCES: return SizeUnits.FluidOunces;
		case LITERS: return SizeUnits.Liters;
		default: return null;
		}
	}
}
